<template>
	<up-radio-group v-model="fieldValue" placement="row" shape="square" v-bind="$attrs">
		<up-radio class="p-r-10" v-for="(item, index) in list" :key="index" :label="item.label" :name="item.value"
			v-bind="item.config">
		</up-radio>
	</up-radio-group>
</template>

<script setup>
	/***
	 * 参数属性
	 * @property {Number | String} modelValue 默认值
	 * @property {Array} [list = []] 单选框数据
	 */
	const props = defineProps({
		modelValue: [Number, String],
		list: {
			type: Array,
			default: () => [],
			required: true,
		},
		isButton: {
			type: Boolean,
			default: false,
		},
	});

	const emits = defineEmits(['update:modelValue']);

	let fieldValue = computed({
		get() {
			return props.modelValue;
		},
		set(val) {
			emits('update:modelValue', val);
		},
	});
</script>
<style lang="scss" scoped></style>